﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Reflection;

namespace XSerialization
{
    public static class Naming
    {
        public static string GetPropertyName(PropertyInfo p)
        {
            return p.Name;
        }

        public static string GetObjectName(object obj)
        {
            if (obj.GetType().IsGenericType)
            {
                return obj.GetType().Name.Substring(0, obj.GetType().Name.IndexOf('`'));
            }
            return obj.GetType().Name;
        }
    }
}
